package com.pattern.decorator.case02;

import java.math.BigDecimal;

/**
 * 草莓小料——ConcreteComponent
 */
public class StrawBerryDecorator extends Condiment{

    private final Beverage beverage;

    public StrawBerryDecorator(Beverage beverage){
        this.beverage = beverage;
    }

    @Override
    public String type() {
        return beverage.type() + "加了一点草莓小料";
    }

    @Override
    public BigDecimal price() {
        BigDecimal price = beverage.price();
        return BigDecimal.valueOf(5).add(price);
    }
}
